﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using WpsConvert;

namespace WordPaser
{
    class Program
    {
        static void Main()
        {
            QueenHelper q = new QueenHelper();
            q.Received = (data) => {

              string filepath =  Path.Combine(AppDomain.CurrentDomain.BaseDirectory, data);
                string htmlpath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, data.Replace("docx","html").Replace("doc", "html"));
                
                BaseResult result = Word2HtmlConvert.Convert(filepath);

                if (result.isSuccess)
                {
                    Console.WriteLine(data + " is Converted");
                }
                else
                {
                    Console.WriteLine(result.Message);
                }

            };
            q.Listen();
            
            Console.ReadLine();
        }
    }
}
